open(BUFF,"WR_BRCA_normalized_450_methylation_tumor_normal_only.txt") or die "no file found BRCA_normalized_mrnaSEQv2.txt\n";
open(WRBUFF,">methy_sample_info.txt");
$line=<BUFF>;
chomp($line);
#die $line;
@array=split("\t",$line);
print WRBUFF "FileName\tFactor\tDisease\n";
$num=1;
for($i=0;$i<@array;$i++)
{
	@a=split('-',$array[$i]);
	#print WRBUFF "\t$a[5]";
	#print "$a[5]\n";
	$a[3]=~ s/A//g;
	$a[3] =~ s/B//g;
	#die "$a[3]\n";
	if(!exists($hash{"$a[0]-$a[1]-$a[2]"}))
	{
		$hash{"$a[0]-$a[1]-$a[2]"}=$num;
		$num++;
	} 
	if($a[3] eq "01")
        {
                print WRBUFF "$array[$i]\t".$hash{"$a[0]-$a[1]-$a[2]"}."\tT\n";
        }
        else
        {
                print WRBUFF "$array[$i]\t".$hash{"$a[0]-$a[1]-$a[2]"}."\tC\n";
        }
}
